package com.ceac.kronos.ejb.sessionbeans;

import com.ceac.kronos.ejb.entitybeans.Category;
import com.ceac.kronos.ejb.entitybeans.Checkpoint;
import com.ceac.kronos.ejb.entitybeans.Competition;
import com.ceac.kronos.ejb.entitybeans.Edition;
import com.ceac.kronos.ejb.entitybeans.Participant;
import com.ceac.kronos.ejb.entitybeans.Person;
import com.ceac.kronos.ejb.entitybeans.Race;
import com.ceac.kronos.ejb.entitybeans.Role;
import com.ceac.kronos.ejb.entitybeans.Time;

import java.util.Date;
import java.util.List;

import javax.ejb.Remote;

@Remote
public interface KronosSessionEJB {
    Time persistTime(Time time);

    Time mergeTime(Time time);

    void removeTime(Time time);

    List<Time> getTimeFindAll();

    Edition persistEdition(Edition edition);

    Edition mergeEdition(Edition edition);

    void removeEdition(Edition edition);

    List<Edition> getEditionFindAll();

    Competition persistCompetition(Competition competition);

    Competition mergeCompetition(Competition competition);

    void removeCompetition(Competition competition);

    List<Competition> getCompetitionFindAll();

    Category persistCategory(Category category);

    Category mergeCategory(Category category);

    void removeCategory(Category category);

    List<Category> getCategoryFindAll();

    Participant persistParticipant(Participant participant);

    Participant mergeParticipant(Participant participant);

    void removeParticipant(Participant participant);

    List<Participant> getParticipantFindAll();

    Race persistRace(Race race);

    Race mergeRace(Race race);

    void removeRace(Race race);

    List<Race> getRaceFindAll();

    Checkpoint persistCheckpoint(Checkpoint checkpoint);

    Checkpoint mergeCheckpoint(Checkpoint checkpoint);

    void removeCheckpoint(Checkpoint checkpoint);

    List<Checkpoint> getCheckpointFindAll();

    Person persistPerson(Person person);

    Person mergePerson(Person person);

    void removePerson(Person person);

    List<Person> getPersonFindAll();

    Role persistRole(Role role);

    Role mergeRole(Role role);

    void removeRole(Role role);

    List<Role> getRoleFindAll();

    Competition getCompetitionFindByName(String name);

    Person getPersonFindByIdCard(String idCard);

    Edition getEditionFindByName(Competition competition, Integer editionNumber);
    
    Race getRaceFindByName(Edition edition, String name);

    List<Edition> getEditionFindByCompetition(Competition competition);

    List<Edition> getEditionFindByNumber(Competition competition,
                                         Integer editionNumber);

    List<Competition> getCompetitionFindById(Integer competitionId);

    List<Participant> getParticipantFindParticipation(Person person,
                                                      Race race);

    List<Competition> getCompetitionFindByCode(String name);

    List<Race> getRaceFindById(Integer raceId);

    List<Participant> getParticipantFindByBibsNumber(Race race,
                                                     Integer bibsNumber);

    void createCompetition(String code, String name, String description, int edition, Date date, String raceDescription, int distance, int bibsStart, int bibsLimit);
}
